<form action="#" method="post"  style="width:auto; float:left;">
		<?php 
		  //Page results
		  $db = new Database();
		  $db->connectToDB();
		  $results =  $resultHandler->displayResults(1); 
		  //All tickets for filtering
		
		 
		  $filter = new Filter($_SESSION['allTickets']);
		 
		  $from = explode("-",$_SESSION['search']->getDepartureCity());
		  $to = explode("-",$_SESSION['search']->getDestinationCity());
		?>
		
		<div class="searchBox">
			<div class="searchBoxHeader"><div class="zoekopdracht">Zoekopdracht:</div></div>
			<div class="searchBoxInfo">
				<div class="shortInfo">
					<b>van:</b><span class="fromCity"><?php echo  $from[0]; ?></span><br/>
				    <b>naar: </b><span class="toCity"><?php echo $to[0]; ?></span><br/>
				   <span class="displayDate">Datum: <?php  ?> 
				   <?php
				   echo $_SESSION['search']->getDepartureDate();
				   if($_GET['retDate'] != ""){ 
						echo " t/m ".$_SESSION['search']->getReturnDate();
					}
				   ?>
				   </span>
				</div>
			</div>
		</div>
   
    


    <br/>
	
	<div class="filterBox">
		<div class="filterBoxHeader"><div class="zoekopdracht">Filter opties</div></div>
		<div class="filterBoxInfo">
			<div class="shortInfo">
				<h2 class="orangeText">Laagste prijs</h2>
				<span class="lowPrice"> 
				
				<?php 
				$lowPrice  = $filter->getLowestPrice();
				echo '<a class="lowPriceLink" href="'.$lowPrice['url'].'">&euro; '.$lowPrice['price'].'</a>'; 
				?>
				</span>
				<div class="filterSeperator"></div>
				<h2 class="orangeText">Tussenstops</h2>
					<?php 
					
					$stopPrices = $filter->getStops();
					
					foreach ($stopPrices as $item => $price){
						if($item == 0){
							echo "<span class=\"tussenstop\"><input type=\"checkbox\"  onchange=\"disableStop('$item', 'results')\" checked=\"checked\"> Directe vlucht</span><span class=\"carrierPrice\">&euro; ". $price  . "</span><br/>";
						}
						else{
							echo "<span class=\"tussenstop\"><input type=\"checkbox\"  onchange=\"disableStop('$item', 'results')\" checked=\"checked\"> ". $item .".Tussenstop</span><span class=\"carrierPrice\">&euro; ". $price  . "</span><br/>";
						}
					}
					$reisduurMax = $filter->getMaxTime();
					$maxReis = ($reisduurMax[0] * 60) + $reisduurMax[1];
					$reisduurMin = $filter->getMinTime();
					$minReis = ($reisduurMin[0] * 60) + $reisduurMin[1];
		
				?>
				<div class="filterSeperator"></div>
				<h2 class="orangeText">Vertrektijden</h2>	   
				<script>
					$(function() {
						
						$( "#heenreis-range" ).slider({
							range: true,
							values: [0,1440],
							min: 0,
							max: 1440,
							step: 30,
							slide: function(e, ui) {
							   if(ui.values[1] == 1440) ui.values[1] = 1439;
							   if(ui.values[0] == 1440) ui.values[0] = 1439;
							   var hours = Math.floor(ui.values[0] / 60);
							   var minutes = ui.values[0] - (hours * 60);
								

							   
							   var hours2 = Math.floor(ui.values[1] / 60);
							   var minutes2 = ui.values[1] - (hours2 * 60);
							 
							 
							   if(hours < 10) hours = '0' + hours;
							   if(minutes < 10) minutes = '0' + minutes;
							   
							   if(hours2 < 10) hours2 = '0' + hours2;
							   if(minutes2 < 10) minutes2 = '0' + minutes2;
								
							    var beginTijd = hours + '' + minutes;
								var terugTijd = hours2 + '' + minutes2;
								
								$('.heentijd').html(hours+':'+minutes+" - "+hours2+':'+minutes2);
								heenreis('results',beginTijd,terugTijd);
							}
							
						});
						
						$( "#terugreis-range" ).slider({
							range: true,
							values: [0,1440],
							min: 0,
							max: 1440,
							step: 30,
							slide: function(e, ui) {
							   if(ui.values[1] == 1440) ui.values[1] = 1439;
							   if(ui.values[0] == 1440) ui.values[0] = 1439;
							   var hours = Math.floor(ui.values[0] / 60);
							   var minutes = ui.values[0] - (hours * 60);	
							   
							   
							   var hours2 = Math.floor(ui.values[1] / 60);
							   var minutes2 = ui.values[1] - (hours2 * 60);
							 
							 
							   if(hours < 10) hours = '0' + hours;
							   if(minutes < 10) minutes = '0' + minutes;
							   
							   if(hours2 < 10) hours2 = '0' + hours2;
							   if(minutes2 < 10) minutes2 = '0' + minutes2;
							   
								var beginTijd = hours + '' + minutes;
								var terugTijd = hours2 + '' + minutes2;
								
								$('.terugtijd').html(hours+':'+minutes+" - "+hours2+':'+minutes2);
								terugreis('results',beginTijd,terugTijd);
							}
							
						});
						
						
							$( "#reisduur-range" ).slider({
							range: true,
							values: [0,1400],
							min: <?php echo $minReis; ?>,
							max: <?php echo $maxReis; ?>,
							step: 30,
							slide: function(e, ui) {
							   var hours = Math.floor(ui.values[0] / 60);
							   var minutes = ui.values[0] - (hours * 60);	
							   
							   
							   var hours2 = Math.floor(ui.values[1] / 60);
							   var minutes2 = ui.values[1] - (hours2 * 60);
							 
							 
							   if(hours < 10) hours = '0' + hours;
							   if(minutes < 10) minutes = '0' + minutes;
							   
							   if(hours2 < 10) hours2 = '0' + hours2;
							   if(minutes2 < 10) minutes2 = '0' + minutes2;
							   
								var beginTijd = hours + '' + minutes;
								var terugTijd = hours2 + '' + minutes2;
						
								$('.reistijd').html(hours+':'+minutes+" - "+hours2+':'+minutes2);
								reistijd('results',beginTijd,terugTijd);
							}
							
						});
					});
					</script>
				<div id="heenreis">Heenreis:<span class="heentijd">00:00 - 23:59</span></div><br/>
				<div id="heenreis-range"></div>
				<br/>
				<?php  if($_GET['retDate'] != ""){  echo'
					<div id="terugreis">Terugreis:<span class="terugtijd">00:00 - 23:59</span></div><br/>
					<div id="terugreis-range"></div>';
				} ?>
				<div class="filterSeperator"></div>
				<h2 class="orangeText">Luchtvaartmaatschapijen</h2>
					<?php 
					$maatschappijen = $filter->getCarriers();
					
					
					foreach ($maatschappijen as $carrier => $status){
						echo "<span class=\"tussenstop\"><input type=\"checkbox\"  onchange=\"disableCarrier('$carrier', 'results')\" checked=\"checked\">  ";
						
						$carrierName = $db->getCarrierInfo($carrier);
						echo  $carrierName[0];
						echo "<span class=\"carrierPrice\">&euro; ". $status  . "</span>";
						echo "</span><br/>";	
					}

				?>
				<!--<style>
				#demo-frame > div.demo { padding: 10px !important; };
				</style>-->
			   
			
		   
			<div class="filterSeperator"></div>
			<h2 class="orangeText">Reisduur</h2>
				<div id="heenreis">Reisduur:<span class="reistijd"> <?php echo $reisduurMin[0] . ":". $reisduurMin[1]; ?> - <?php echo $reisduurMax[0] . ":". $reisduurMax[1]; ?></span></div><br/>
				<div id="reisduur-range"></div>
			</div>
		</div>
	 </div>
	 <br/>
	 <div class="filterBox">
		<div class="filterBoxHeader" style="background-color:#c8c8c8;">
			<div class="zoekopdracht">Reisbureaus</div>
			
		</div>
		<div class="filterBoxInfo">
			<div class="shortInfo">Klik hieronder op het reisbureau om de prijzen te laden. Binnen enkele seconden ziet u automatisch de prijzen. <br/><br/>
				<b>van:</b><span class="fromCity"><?php echo $from[0]; ?></span><br/>
				    <b>naar: </b><span class="toCity"><?php echo $to[0]; ?></span><br/>
				   <span class="displayDate">Datum: <?php echo $_GET['deptDate'] ?> <?php if($_GET['retDate'] != ""){ echo " t/m ".$_GET['retDate'];}?></span>
			<div id="banners">
				<div class="banner"><img class="banner" src="images/carriers/cheapticketsgroot.png" alt="cheaptickets"/></div>
				<div class="banner"><img class="banner" src="images/carriers/budgetairgroot.png" alt="cheaptickets"/></div>
				<div class="banner"><img class="banner" src="images/carriers/tixgroot.png" alt="cheaptickets"/></div>
				<div class="banner"><img class="banner" src="images/carriers/vliegticketsgroot.png" alt="cheaptickets"/></div>
				<div class="banner"><img class="banner" src="images/carriers/wtcgroot.png" alt="cheaptickets"/></div>
			</div></div>
		</div>
	</div>
         <br/>
	
</form>
